// pages/rome/rome.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    banner:"https://app.xmtapp.gdwlcloud.com/content/preview/ainingshan/upload/news/image/2024/08/05/1722833340435090694.jpg",
    icons:[
      {title:"公告",path:"/icon/gg.png"},
      {title:"大床",path:"/icon/bed.png"},
      {title:"电梯",path:"/icon/dt.png"},
      {title:"空调",path:"/icon/kt.png"},
      {title:"电视",path:"/icon/tv.png"},
      {title:"WIFI",path:"/icon/wifi.png"},
      {title:"洗衣机",path:"/icon/xy.png"}
    ],
    addr_info:"江苏省南京市江宁区东吉大道江苏软件园",
    map:"https://bpic.51yuansu.com/pic3/cover/04/21/59/654455576d97d_800.jpg?x-oss-process=image/resize,h_360,m_lfit/sharpen,100"
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    let {id} = options
    const that = this
    wx.request({
      url: 'http://localhost:8082/wx/room/getRoomById?hid=' + id,
      method:'GET',
      success(res){
        const roomList = res.data.data
        that.setData({
          roomList : roomList
        })
      }
    })
  },
  goReservation(e){
    let {id} = e.currentTarget.dataset
    wx.navigateTo({
      url: '/pages/reservation/index?id=' + id,
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})